package com.ncsc.erp.model;
// Generated 20 มิ.ย. 2557, 12:55:43 by Hibernate Tools 3.4.0.CR1


import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * PcPurchaseOrder generated by hbm2java
 */
@Entity
@Table(name="pc_purchase_order"
    ,catalog="ncsc_erp"
)
public class PcPurchaseOrder  implements java.io.Serializable {


     private long poNo;
     private SysTitleName sysTitleName;
     private MmSupplierType mmSupplierType;
     private PcPurchaseOrderStatus pcPurchaseOrderStatus;
     private HrEmp hrEmp;
     private SysTermOfPayment sysTermOfPayment;
     private MmSupplier mmSupplier;
     private PcPurchaseReq pcPurchaseReq;
     private String poCode;
     private String poDescr;
     private Date poDate;
     private String poRefSupplierQtCode;
     private String poSupplierCode;
     private String poSupplierFirstName;
     private String poSupplierMidName;
     private String poSupplierLastName;
     private String poSupplierIdCardNo;
     private String poTermOfPaymentCode;
     private BigDecimal poDiscountPerc;
     private BigDecimal poDiscountVal;
     private BigDecimal poDiscountTotal;
     private short poStatusIncVat;
     private BigDecimal poVatPercVal;
     private BigDecimal poTotalPriceExcVat;
     private BigDecimal poTotalVat;
     private BigDecimal poTotalPrice;
     private Date poCreatedDtm;
     private String poMemo;
     private Set<PcPurchaseOrderSupplierAddr> pcPurchaseOrderSupplierAddrs = new HashSet<PcPurchaseOrderSupplierAddr>(0);
     private Set<PcPurchaseOrderItem> pcPurchaseOrderItems = new HashSet<PcPurchaseOrderItem>(0);
     private Set<PcPurchaseReceipt> pcPurchaseReceipts = new HashSet<PcPurchaseReceipt>(0);
     private Set<PcPurchaseOrderSupplierContact> pcPurchaseOrderSupplierContacts = new HashSet<PcPurchaseOrderSupplierContact>(0);

    public PcPurchaseOrder() {
    }

	
    public PcPurchaseOrder(long poNo, String poCode, String poDescr, Date poDate, BigDecimal poDiscountPerc, BigDecimal poDiscountVal, BigDecimal poDiscountTotal, short poStatusIncVat, BigDecimal poVatPercVal, BigDecimal poTotalPriceExcVat, BigDecimal poTotalVat, BigDecimal poTotalPrice) {
        this.poNo = poNo;
        this.poCode = poCode;
        this.poDescr = poDescr;
        this.poDate = poDate;
        this.poDiscountPerc = poDiscountPerc;
        this.poDiscountVal = poDiscountVal;
        this.poDiscountTotal = poDiscountTotal;
        this.poStatusIncVat = poStatusIncVat;
        this.poVatPercVal = poVatPercVal;
        this.poTotalPriceExcVat = poTotalPriceExcVat;
        this.poTotalVat = poTotalVat;
        this.poTotalPrice = poTotalPrice;
    }
    public PcPurchaseOrder(long poNo, SysTitleName sysTitleName, MmSupplierType mmSupplierType, PcPurchaseOrderStatus pcPurchaseOrderStatus, HrEmp hrEmp, SysTermOfPayment sysTermOfPayment, MmSupplier mmSupplier, PcPurchaseReq pcPurchaseReq, String poCode, String poDescr, Date poDate, String poRefSupplierQtCode, String poSupplierCode, String poSupplierFirstName, String poSupplierMidName, String poSupplierLastName, String poSupplierIdCardNo, String poTermOfPaymentCode, BigDecimal poDiscountPerc, BigDecimal poDiscountVal, BigDecimal poDiscountTotal, short poStatusIncVat, BigDecimal poVatPercVal, BigDecimal poTotalPriceExcVat, BigDecimal poTotalVat, BigDecimal poTotalPrice, Date poCreatedDtm, String poMemo, Set<PcPurchaseOrderSupplierAddr> pcPurchaseOrderSupplierAddrs, Set<PcPurchaseOrderItem> pcPurchaseOrderItems, Set<PcPurchaseReceipt> pcPurchaseReceipts, Set<PcPurchaseOrderSupplierContact> pcPurchaseOrderSupplierContacts) {
       this.poNo = poNo;
       this.sysTitleName = sysTitleName;
       this.mmSupplierType = mmSupplierType;
       this.pcPurchaseOrderStatus = pcPurchaseOrderStatus;
       this.hrEmp = hrEmp;
       this.sysTermOfPayment = sysTermOfPayment;
       this.mmSupplier = mmSupplier;
       this.pcPurchaseReq = pcPurchaseReq;
       this.poCode = poCode;
       this.poDescr = poDescr;
       this.poDate = poDate;
       this.poRefSupplierQtCode = poRefSupplierQtCode;
       this.poSupplierCode = poSupplierCode;
       this.poSupplierFirstName = poSupplierFirstName;
       this.poSupplierMidName = poSupplierMidName;
       this.poSupplierLastName = poSupplierLastName;
       this.poSupplierIdCardNo = poSupplierIdCardNo;
       this.poTermOfPaymentCode = poTermOfPaymentCode;
       this.poDiscountPerc = poDiscountPerc;
       this.poDiscountVal = poDiscountVal;
       this.poDiscountTotal = poDiscountTotal;
       this.poStatusIncVat = poStatusIncVat;
       this.poVatPercVal = poVatPercVal;
       this.poTotalPriceExcVat = poTotalPriceExcVat;
       this.poTotalVat = poTotalVat;
       this.poTotalPrice = poTotalPrice;
       this.poCreatedDtm = poCreatedDtm;
       this.poMemo = poMemo;
       this.pcPurchaseOrderSupplierAddrs = pcPurchaseOrderSupplierAddrs;
       this.pcPurchaseOrderItems = pcPurchaseOrderItems;
       this.pcPurchaseReceipts = pcPurchaseReceipts;
       this.pcPurchaseOrderSupplierContacts = pcPurchaseOrderSupplierContacts;
    }
   
     @Id 

    
    @Column(name="PO_NO", unique=true, nullable=false)
    public long getPoNo() {
        return this.poNo;
    }
    
    public void setPoNo(long poNo) {
        this.poNo = poNo;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PO_SUPPLIER_TITLE_NO")
    public SysTitleName getSysTitleName() {
        return this.sysTitleName;
    }
    
    public void setSysTitleName(SysTitleName sysTitleName) {
        this.sysTitleName = sysTitleName;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PO_SUPPLIER_TYPE_NO")
    public MmSupplierType getMmSupplierType() {
        return this.mmSupplierType;
    }
    
    public void setMmSupplierType(MmSupplierType mmSupplierType) {
        this.mmSupplierType = mmSupplierType;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PO_STATUS_NO")
    public PcPurchaseOrderStatus getPcPurchaseOrderStatus() {
        return this.pcPurchaseOrderStatus;
    }
    
    public void setPcPurchaseOrderStatus(PcPurchaseOrderStatus pcPurchaseOrderStatus) {
        this.pcPurchaseOrderStatus = pcPurchaseOrderStatus;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PO_CREATED_BY_EMP_NO")
    public HrEmp getHrEmp() {
        return this.hrEmp;
    }
    
    public void setHrEmp(HrEmp hrEmp) {
        this.hrEmp = hrEmp;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PO_TERM_OF_PAYMENT_NO")
    public SysTermOfPayment getSysTermOfPayment() {
        return this.sysTermOfPayment;
    }
    
    public void setSysTermOfPayment(SysTermOfPayment sysTermOfPayment) {
        this.sysTermOfPayment = sysTermOfPayment;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PO_SUPPLIER_NO")
    public MmSupplier getMmSupplier() {
        return this.mmSupplier;
    }
    
    public void setMmSupplier(MmSupplier mmSupplier) {
        this.mmSupplier = mmSupplier;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="PO_REF_PR_NO")
    public PcPurchaseReq getPcPurchaseReq() {
        return this.pcPurchaseReq;
    }
    
    public void setPcPurchaseReq(PcPurchaseReq pcPurchaseReq) {
        this.pcPurchaseReq = pcPurchaseReq;
    }

    
    @Column(name="PO_CODE", nullable=false, length=50)
    public String getPoCode() {
        return this.poCode;
    }
    
    public void setPoCode(String poCode) {
        this.poCode = poCode;
    }

    
    @Column(name="PO_DESCR", nullable=false, length=100)
    public String getPoDescr() {
        return this.poDescr;
    }
    
    public void setPoDescr(String poDescr) {
        this.poDescr = poDescr;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="PO_DATE", nullable=false, length=10)
    public Date getPoDate() {
        return this.poDate;
    }
    
    public void setPoDate(Date poDate) {
        this.poDate = poDate;
    }

    
    @Column(name="PO_REF_SUPPLIER_QT_CODE", length=30)
    public String getPoRefSupplierQtCode() {
        return this.poRefSupplierQtCode;
    }
    
    public void setPoRefSupplierQtCode(String poRefSupplierQtCode) {
        this.poRefSupplierQtCode = poRefSupplierQtCode;
    }

    
    @Column(name="PO_SUPPLIER_CODE", length=50)
    public String getPoSupplierCode() {
        return this.poSupplierCode;
    }
    
    public void setPoSupplierCode(String poSupplierCode) {
        this.poSupplierCode = poSupplierCode;
    }

    
    @Column(name="PO_SUPPLIER_FIRST_NAME", length=50)
    public String getPoSupplierFirstName() {
        return this.poSupplierFirstName;
    }
    
    public void setPoSupplierFirstName(String poSupplierFirstName) {
        this.poSupplierFirstName = poSupplierFirstName;
    }

    
    @Column(name="PO_SUPPLIER_MID_NAME", length=50)
    public String getPoSupplierMidName() {
        return this.poSupplierMidName;
    }
    
    public void setPoSupplierMidName(String poSupplierMidName) {
        this.poSupplierMidName = poSupplierMidName;
    }

    
    @Column(name="PO_SUPPLIER_LAST_NAME", length=50)
    public String getPoSupplierLastName() {
        return this.poSupplierLastName;
    }
    
    public void setPoSupplierLastName(String poSupplierLastName) {
        this.poSupplierLastName = poSupplierLastName;
    }

    
    @Column(name="PO_SUPPLIER_ID_CARD_NO", length=20)
    public String getPoSupplierIdCardNo() {
        return this.poSupplierIdCardNo;
    }
    
    public void setPoSupplierIdCardNo(String poSupplierIdCardNo) {
        this.poSupplierIdCardNo = poSupplierIdCardNo;
    }

    
    @Column(name="PO_TERM_OF_PAYMENT_CODE", length=50)
    public String getPoTermOfPaymentCode() {
        return this.poTermOfPaymentCode;
    }
    
    public void setPoTermOfPaymentCode(String poTermOfPaymentCode) {
        this.poTermOfPaymentCode = poTermOfPaymentCode;
    }

    
    @Column(name="PO_DISCOUNT_PERC", nullable=false, precision=10)
    public BigDecimal getPoDiscountPerc() {
        return this.poDiscountPerc;
    }
    
    public void setPoDiscountPerc(BigDecimal poDiscountPerc) {
        this.poDiscountPerc = poDiscountPerc;
    }

    
    @Column(name="PO_DISCOUNT_VAL", nullable=false, precision=15)
    public BigDecimal getPoDiscountVal() {
        return this.poDiscountVal;
    }
    
    public void setPoDiscountVal(BigDecimal poDiscountVal) {
        this.poDiscountVal = poDiscountVal;
    }

    
    @Column(name="PO_DISCOUNT_TOTAL", nullable=false, precision=15)
    public BigDecimal getPoDiscountTotal() {
        return this.poDiscountTotal;
    }
    
    public void setPoDiscountTotal(BigDecimal poDiscountTotal) {
        this.poDiscountTotal = poDiscountTotal;
    }

    
    @Column(name="PO_STATUS_INC_VAT", nullable=false)
    public short getPoStatusIncVat() {
        return this.poStatusIncVat;
    }
    
    public void setPoStatusIncVat(short poStatusIncVat) {
        this.poStatusIncVat = poStatusIncVat;
    }

    
    @Column(name="PO_VAT_PERC_VAL", nullable=false, precision=10)
    public BigDecimal getPoVatPercVal() {
        return this.poVatPercVal;
    }
    
    public void setPoVatPercVal(BigDecimal poVatPercVal) {
        this.poVatPercVal = poVatPercVal;
    }

    
    @Column(name="PO_TOTAL_PRICE_EXC_VAT", nullable=false, precision=15)
    public BigDecimal getPoTotalPriceExcVat() {
        return this.poTotalPriceExcVat;
    }
    
    public void setPoTotalPriceExcVat(BigDecimal poTotalPriceExcVat) {
        this.poTotalPriceExcVat = poTotalPriceExcVat;
    }

    
    @Column(name="PO_TOTAL_VAT", nullable=false, precision=15)
    public BigDecimal getPoTotalVat() {
        return this.poTotalVat;
    }
    
    public void setPoTotalVat(BigDecimal poTotalVat) {
        this.poTotalVat = poTotalVat;
    }

    
    @Column(name="PO_TOTAL_PRICE", nullable=false, precision=15)
    public BigDecimal getPoTotalPrice() {
        return this.poTotalPrice;
    }
    
    public void setPoTotalPrice(BigDecimal poTotalPrice) {
        this.poTotalPrice = poTotalPrice;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="PO_CREATED_DTM", length=19)
    public Date getPoCreatedDtm() {
        return this.poCreatedDtm;
    }
    
    public void setPoCreatedDtm(Date poCreatedDtm) {
        this.poCreatedDtm = poCreatedDtm;
    }

    
    @Column(name="PO_MEMO", length=500)
    public String getPoMemo() {
        return this.poMemo;
    }
    
    public void setPoMemo(String poMemo) {
        this.poMemo = poMemo;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="pcPurchaseOrder")
    public Set<PcPurchaseOrderSupplierAddr> getPcPurchaseOrderSupplierAddrs() {
        return this.pcPurchaseOrderSupplierAddrs;
    }
    
    public void setPcPurchaseOrderSupplierAddrs(Set<PcPurchaseOrderSupplierAddr> pcPurchaseOrderSupplierAddrs) {
        this.pcPurchaseOrderSupplierAddrs = pcPurchaseOrderSupplierAddrs;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="pcPurchaseOrder")
    public Set<PcPurchaseOrderItem> getPcPurchaseOrderItems() {
        return this.pcPurchaseOrderItems;
    }
    
    public void setPcPurchaseOrderItems(Set<PcPurchaseOrderItem> pcPurchaseOrderItems) {
        this.pcPurchaseOrderItems = pcPurchaseOrderItems;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="pcPurchaseOrder")
    public Set<PcPurchaseReceipt> getPcPurchaseReceipts() {
        return this.pcPurchaseReceipts;
    }
    
    public void setPcPurchaseReceipts(Set<PcPurchaseReceipt> pcPurchaseReceipts) {
        this.pcPurchaseReceipts = pcPurchaseReceipts;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="pcPurchaseOrder")
    public Set<PcPurchaseOrderSupplierContact> getPcPurchaseOrderSupplierContacts() {
        return this.pcPurchaseOrderSupplierContacts;
    }
    
    public void setPcPurchaseOrderSupplierContacts(Set<PcPurchaseOrderSupplierContact> pcPurchaseOrderSupplierContacts) {
        this.pcPurchaseOrderSupplierContacts = pcPurchaseOrderSupplierContacts;
    }




}


